<?php

class Control_Model_Form_Scroll extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('portfolio');
        $this->setAttrib('enctype', 'multipart/form-data');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Name:')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty')
                ->setAttrib('size', 50);

        $text = new Zend_Form_Element_Textarea('text');
        $text->setLabel('Text:')
            ->setRequired(true)
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('class', 'elrte');

        $image = new Zend_Form_Element_File('image');
        $image->setLabel('Background image:')
                ->setDestination('images/user/original/')
                ->addValidator('Extension', TRUE, 'jpg,png,gif');


//        $logo = new Zend_Form_Element_Text('logo');
//        $logo->setLabel('logo adress')
//                    ->setRequired(true)
//                    ->addFilter('StripTags')
//                    ->addFilter('StringTrim')
//                    ->addValidator('NotEmpty')
//                    ->setAttrib('size', 50);

        $link = new Zend_Form_Element_Text('link');
        $link->setLabel('Link adress:')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty')
                ->setAttrib('size', 50);


        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($id, $name, $text, $image, $link, $submit));
    }
}